#include "ShaderMaterial.h"


ShaderMaterial::ShaderMaterial(Technique* technique):m_pTechnique(technique)
{
}

ShaderMaterial::~ShaderMaterial(void)
{
	map<tstring,FXParameter*>::iterator it;
	for ( it = m_NameMap.begin(); it != m_NameMap.end(); it++)
	{
		delete (*it).second;
	}
}

void ShaderMaterial::AddParameter(tstring name, FXParameter* parameter)
{
	m_NameMap[name]=parameter;
}

FXParameter* ShaderMaterial::GetParameter(tstring name){
	map<tstring,FXParameter*>::iterator it;
	it = m_NameMap.find(name);
	if ( it != m_NameMap.end())
		return (*it).second;
	else
		return NULL;
}
